s = input("请输入一串字符:")
alpha, dight, space, ohter = 0, 0, 0, 0
for i in s:
    if str.isalpha(i):
        alpha += 1
    elif str.isdigit(i):
        dight += 1
    elif str.isspace(i):
        space += 1
    else:
        ohter += 1
print("字母个数为{},数字个数为{},空格个数为{},其他字符个数为{}".format(alpha, dight, space, ohter))
